package com.paw.ruoyi.admin.service;

import java.io.IOException;
import java.io.InputStream;

import com.paw.ruoyi.admin.common.domain.Result;
import com.paw.ruoyi.admin.exceptions.file.InvalidExtensionException;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Rubble
 * @date 2022/3/10
 * @see com.paw.ruoyi.admin.core.util.FileUploadUtil
 **/
public interface IFileUploadService {


  /**
   * 获取域名
   * @return
   */
 Result<String> getDomainUrl();
  /**
   * 通过key获取url
   * @param key
   * @return
   */
  Result<String>  getUrl(String key);

  /**
   * 通过url获取key
   * @param url
   * @return
   */
  Result<String>  getKey(String url);

  /**
   * 文件上传
   * @param file
   * @return
   */
  Result<String>  uploadFile(MultipartFile file) throws InvalidExtensionException, IOException;

  /**
   * 文件上传
   * @param inputStream
   * @param fileName
   * @return
   */
  Result<String>  upload(InputStream inputStream,String fileName) throws IOException;



}
